Skip to main content

PreviewStack

Description

call the PreviewStack interface to preview the resource stack information to be created by the specified template.

Request Method

POST

Request Path

/apsara/route/ROS/PreviewStack

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
Parameters.N.ParameterKeyBODYstringYesInstanceTypethe name of the parameter. If the name and value of the parameter are not specified, ROS will use the default value specified in the template. The maximum value of n is 200. description Parameters as an optional parameter. if the Parameters needs to be specified, the Parameters. n. ParameterKey and Parameters. n. ParameterValue must be specified at the same time.
Parameters.N.ParameterValueBODYstringYesecs.cm4.6xlargeparameter value. The maximum value of n is 200. description Parameters as an optional parameter. if the Parameters needs to be specified, the Parameters. n. ParameterKey and Parameters. n. ParameterValue must be specified at the same time.
TemplateBodyBODYstringNo{"ROSTemplateFormatVersion": "2015-09-01" }the structure of the template body. The length is 1~524 and 288 bytes. If the length is large, it is recommended to pass the parameters in the request body through HTTP POST + Body Param to avoid request failure due to too long URL. description you must specify the parameter TemplateBody or TemplateURL, but not at the same time.
StackPolicyBodyBODYstringNo{"Statement": [{"Action": "Update:*", "Resource": "*", "Effect": "Allow", "Principal": "*"}]}contains the structure of the resource stack policy body, with a length of 1~16,384 bytes. description you must specify StackPolicyBody or StackPolicyURL parameters, but not at the same time.
StackPolicyURLBODYstringNooss://ros-stack-policy/demothe location of the file containing the resource stack policy. The URL must point to a policy located in a Web server (HTTP or HTTPS) or Aliyun OSS bucket (for example, oss:// ros/stack-policy/demo, oss:// ros/stack-policy/demo?RegionId = cn-hangzhou). The maximum length of the policy file is 16 and 384 bytes. If the OSS region is not specified, the default RegionId is the same as the interface parameter. description you must specify the parameter StackPolicyBody or StackPolicyURL, but not at the same time. The maximum length of the URL is 1350 bytes.
versionBODYstringNo2016-01-01version of api
TemplateURLBODYstringNooss://ros-template/demothe location of the file containing the template body. The URL must point to the template (1~524,288 bytes) located in the HTTP Web server (HTTP or HTTPS) or Aliyun OSS bucket. The URL of the OSS bucket is such as oss:// ros/template/demo or oss:// ros/template/demo?RegionId = cn-hangzhou. If the OSS region is not specified, the default RegionId is the same as the interface parameter. description you must specify TemplateBody or TemplateURL parameters, but not at the same time.
regionIdBODYstringYesNo sample value for this parameter.region id
RegionIdBODYstringYescn-beijingthe region ID to which the resource stack belongs.
ClientTokenBODYstringNo123e4567-e89b-12d3-a456-42665544****guarantees the idempotence of the request. This value is generated by the client and must be globally unique. is no more than 64 characters in length and can contain English letters, numbers, dashes (-) and underscores (_).
StackNameBODYstringYesMyStackresource stack name. must be no more than 255 characters in length and must start with a number or an English letter, which can contain numbers, English letters, dashes (-), and underscores (_).
DisableRollbackBODYbooleanNofalsewhether to disable the rollback policy when the resource stack creation fails. Value: true: disable rollback, that is, no rollback is performed when the resource stack creation fails. false (default): rollback is not disabled, that is, rollback is performed when the resource stack creation fails.
TimeoutInMinutesBODYlongNo10timeout for creating the resource stack. Unit: minutes. default value: 60.

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}